package bishi2016;

import java.util.*;

//兔子藏洞
public class Cvte_RabbitHole {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int[] circle = new int[20];
		int start, findTimes;
		while (scanner.hasNext()) {
			Arrays.fill(circle, 0); // 每次重新更新
			start = scanner.nextInt();
			findTimes = scanner.nextInt();
			//注意输入的是序号，不是在数组中的下标
			find(circle, findTimes, start - 1);
			boolean hasSolution = false;
			for (int i = 0; i < circle.length; i++) {
				if (circle[i] != 1) {
					System.out.print((i + 1) + " ");
					hasSolution = true;
				}
			}
			if (hasSolution) {
				System.out.println();
			} else {
				System.out.println("-1");
			}
		}
		scanner.close();
	}

	public static void find(int[] circle, int findTimes, int start) {
		int step = 0;
		int findIndex = start;
		step = 1;
		while (findTimes-- >= 0) {
			circle[findIndex] = 1; // 对于已经查找过的标记为1
			step++;
//			System.out.println("step: " + step + "findIndex: " + findIndex);
			findIndex = (findIndex + step) % circle.length;
		}
	}
}
